//
//  CustomCell.m
//  CustomTable
//
//  Created by Alex Muller on 3/15/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "CustomCell.h"


@implementation CustomCell

@synthesize primaryLabel, secondaryLabel, imageView, confBegins;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        primaryLabel = [[UILabel alloc]init];
        primaryLabel.textAlignment = UITextAlignmentLeft;
        primaryLabel.font = [UIFont systemFontOfSize:20];
        primaryLabel.backgroundColor = [UIColor clearColor];
        primaryLabel.textColor = [UIColor lightGrayColor];
//[UIColor whiteColor];
        primaryLabel.numberOfLines = 0;
        secondaryLabel = [[UILabel alloc]init];
        secondaryLabel.textAlignment = UITextAlignmentLeft;
        secondaryLabel.font = [UIFont systemFontOfSize:14];
        secondaryLabel.backgroundColor = [UIColor clearColor];
        secondaryLabel.textColor = [UIColor whiteColor];
        confBegins = [[UILabel alloc] init];
        confBegins.font = [UIFont systemFontOfSize:16];
        confBegins.backgroundColor = [UIColor clearColor];
        confBegins.textColor = [UIColor whiteColor];
        confBegins.text = @"Conference Begins";
        imageView = [[UIImageView alloc]init];
        imageView.image = [UIImage imageNamed:@"noImage"];
        [self.contentView addSubview:primaryLabel];
        [self.contentView addSubview:secondaryLabel];
        [self.contentView addSubview:confBegins];
        [self.contentView addSubview:imageView];
        self.contentView.backgroundColor = [UIColor blackColor];
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    
}

- (void)layoutSubviews {
    
    [super layoutSubviews];
    CGRect contentRect = self.contentView.bounds;
    CGFloat boundsX = contentRect.origin.x;
    CGRect frame;
    
    frame= CGRectMake(boundsX+0, 0, 100, 100);
    imageView.frame = frame;
    
    frame= CGRectMake(boundsX+110, 5, 200, 50);
    primaryLabel.frame = frame;
    
    frame= CGRectMake(boundsX+150, 80, 200, 15);
    secondaryLabel.frame = frame;
    
    frame = CGRectMake(boundsX+110, 55, 200, 20);
    confBegins.frame = frame;
}


- (void)dealloc
{
    [super dealloc];
}

@end
